package com.vang.chue.capm.service;

import com.vang.chue.capm.dao.impl.PersonHibernateDao;
import com.vang.chue.capm.entity.Person;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by IntelliJ IDEA.
 * User: chuevang
 * Date: 11/6/11
 * Time: 1:15 PM
 * To change this template use File | Settings | File Templates.
 */
public class RegistrationService {

    @Autowired
    PersonHibernateDao personHibernateDao;

    public Person registerPerson(String firstName, String lastName, String sex)
    {
        Person person = new Person();
        person.setFirstName(firstName);
        person.setLastName(lastName);
        person.setSex(sex);
        return personHibernateDao.persistOrMerge(person);
    }

}
